<?php defined('_JEXEC') or die('Restricted access'); ?>

<?php
	// clean item data
	JFilterOutput::objectHTMLSafe( $this->user, ENT_QUOTES, '' );

	if ($this->user->get('lastvisitDate') == "0000-00-00 00:00:00") {
		$lvisit = JText::_( 'Never' );
	} else {
		$lvisit	= JHTML::_('date', $this->user->get('lastvisitDate'), '%Y-%m-%d %H:%M:%S');
	}
?>
		<fieldset class="adminform">
		<legend><?php echo 'Szczegóły konta'; ?></legend>
			<table class="admintable" cellspacing="1">
				<tr>
					<td class="key">
						<label for="username">
							<?php echo JText::_( 'Username' ); ?>
						</label>
					</td>
					<td>
						<?php if ( $form_edit ) { ?>
							<input type="text" name="username" id="username" class="inputbox" size="40"                     value="<?php echo $this->user->get('username'); ?>" autocomplete="off" />
						 <?php      } else {  ?>
							<input type="text" name="username" id="username" class="inputbox" size="40" readonly="readonly" value="<?php echo $this->user->get('username'); ?>" autocomplete="off" />
						<?php } ?>
					</td>
				</tr>
				<?php if ( $form_edit ) { ?>
				<tr>
					<td class="key">
						<label for="password">
							<?php echo JText::_( 'New Password' ); ?>
						</label>
					</td>
					<td>
						<?php if(!$this->user->get('password')) : ?>
							<input class="inputbox disabled" type="password" name="password" id="password" size="40" <?php echo $readonly ?> value="" disabled="disabled" />
						<?php else : ?>
							<input class="inputbox" type="password" name="password" id="password" size="40" <?php echo $readonly ?> value=""/>
						<?php endif; ?>
					</td>
				</tr>
				<tr>
					<td class="key">
						<label for="password2">
							<?php echo JText::_( 'Verify Password' ); ?>
						</label>
					</td>
					<td>
						<?php if(!$this->user->get('password')) : ?>
							<input class="inputbox disabled" type="password" name="password2" id="password2" size="40" <?php echo $readonly ?> value="" disabled="disabled" />
						<?php else : ?>
							<input class="inputbox" type="password" name="password2" id="password2" size="40" <?php echo $readonly ?> value=""/>
						<?php endif; ?>
					</td>
				</tr>
				<?php } ?>
				<tr>
					<td valign="top" class="key">
						<label for="gid">
							<?php echo JText::_( 'Group' ); ?>
						</label>
					</td>
					<td>
						<?php if ( $form_edit ) { 
							echo $this->lists['gid']; 
						} else {  ?>
							<input type="text" name="gid" id="gid" class="inputbox" size="40" readonly="readonly"  value="<?php echo $this->user->get('usertype'); ?>" />       	       
						<?php } ?>
					</td>
				</tr>
				<?php if ( $form_edit ) { ?>
				<tr>
					<td class="key">
						<?php echo JText::_( 'Block User' ); ?>
					</td>
					<td>
						<?php echo $this->lists['block']; ?>
					</td>
				</tr>
				<tr>
					<td class="key">
						<?php echo JText::_( 'Receive System Emails' ); ?>
					</td>
					<td>
						<?php echo $this->lists['sendEmail']; ?>
					</td>
				</tr>
				<?php } 
				if ( $this->user->get('id') ) { ?>
				<tr>
					<td class="key">
						<?php echo 'Data pierwszej rejestracji'; ?>
					</td>
					<td>
						<?php echo $this->user->get('pierwszaRejest'); ?>
					</td>
				</tr>
				<tr>
					<td class="key">
						<?php echo JText::_( 'Last Visit Date' ); ?>
					</td>
					<td>
						<?php echo $lvisit; ?>
					</td>
				</tr>
				<?php } ?>
			</table>
		</fieldset>

<?php if ($this->user->get('id') && $delete) { ?>
	<fieldset class="adminform">
	<legend>Konto zostało usunięte</legend>
		<table class="admintable" cellspacing="1">
			<tr>
				<td class="key">
					<?php echo 'w dniu'; ?>
				</td>
				<td>
					<?php echo $this->user->registerDate; ?>
				</td>
			</tr>			
			<tr>
				<td class="key">
					<?php echo 'przez'; ?>
				</td>
				<td>
					<?php echo $this->user->whoRegister; ?>
				</td>
			</tr>	
		</table>
	</fieldset>
<?php } ?>
